import { ActionSheet, Popup } from "@nutui/nutui-react-taro";
import { View } from "@tarojs/components";
import styles from "./index.scss";

type Option = {
  title: string|React.ReactNode;
  onClick: () => void;
  hide?: boolean;
};
type Props = {
  options: Option[];
};
export default ({ options, ...rest }: Props) => {
  return (
    <Popup {...rest}>
      <View className={styles.container}>
        {options?.map(
          (item, index) =>
            !item?.hide && (
              <View className={styles.item} key={index}>
                {item.title}
              </View>
            )
        )}
      </View>
    </Popup>
  );
};
